/**
 * Created by abiu on 2016-04-01.
 */
function rand(min, max, integer) {
    var r = Math.random() * (max - min) + min;
    console.log(typeof r);
    return integer ? r|0 : r;

}
console.log(rand(2,5)); // float random between 2 and 5 inclusive
console.log(rand(1,100,true)); // integer random between 1 and 100